package com.hq.zb.model;

import com.alibaba.fastjson.annotation.JSONField;
import com.alibaba.fastjson.serializer.ToStringSerializer;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.hq.zb.vo.MenuTreeVo;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 用户菜单关系表
 * </p>
 *
 * @author huanghanrui
 * @since 2022-03-07
 */
@Data
@TableName("sys_user_menu")
public class UserMenu extends Model<UserMenu> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 菜单编码
     */
    @TableField("menu_id")
    private Integer menuId;

    /**
     * 用户id
     */
    @TableField("user_id")
    private Integer userId;

    @TableField(exist = false)
    private List<Integer> menuIds;

    @Override
    protected Serializable pkVal() {
        return this.id;
    }
}
